a) Field of the Invention
The present invention relates to digital image processing techniques, and more particularly to an image compression system and method capable of compressing digital image data at high speed and high precision.
b) Description of the Related Art
One example of electronic apparatuses incorporating an image compression system is a digital still camera. A digital still image of a subject can be picked up upon depression of the shutter button of a digital still camera whose lens is directed toward the subject. An optical image focused via the lens is converted into electric signals to form image data. This image data is compressed and stored in a removable memory card or the like. By compressing image data, a large amount of image data can be stored in a memory card.
The amount of coded data obtained through data compression of digitel data changes with the spatial frequency distribution of digital image and with other factors. For example, the amount of coded data of a digital image containing many high frequency components cannot be reduced so much. On the other hand, the amount of coded data of a digital image with less high frequency components can be reduced considerably. Although the amount of coded data of a compressed digital image depends upon a data compression method, it essentially changes with the kind of digital image.
Compressed coded data is stored in a storage device such as a memory card. If the memory card has a capacity of, e.g., 1 Mbyte, image data over 1 Mbyte cannot be stored.
In such a case, it is necessary for a digital still camera not to write coded data in excess of 1 Mbyte, or it is convenient for a user to be notified of the number of recordable frames left. If the amount of compressed coded data per frame is the same irrespective of the kind of subjects, it is easy to notify the user of the number of recordable frames left.
However, if the amount of coded data is variable, it is not possible to notify the user of the number of left frames. If the expected amount of coded data of images to be picked up is small, a relatively large number of frames can be recorded, whereas if the expected coded data amount is large, a relatively small number of frames can be recorded.
From this viewpoint, a fixed length process for coded data has been employed in compressing digital image data. With this fixed length process, a digital image of any kind can be compressed into coded data having generally the same data amount. The fixed length process compresses digital image data of one frame into fixed length coded data. If the coded data of each image has a fixed length, it is easy to notify a user of the number of remaining frames.
The fixed length process will be described in more detail. For this process, a statistical process is first executed as a pre-process. Then, in accordance with the statistical process results, a data compression factor is controlled to generate coded data having a fixed length.
As a user depresses the shutter button of a digital still camera, a digital image is picked up into the camera. This picked-up digital image is then subjected to a statistical process. This process estimates the amount of coded data to be obtained after compression.
After the statistical process, a compression process and a storage process are performed. If the amount of data estimated by the statistical process is larger than a predetermined value, the compression factor is set higher, whereas if it is smaller, the compression factor is set lower. In this manner, the amount of compressed coded data is always set generally the same.
Next, the storage process stores the compressed coded data into a memory card. A series of processes from image pickup to data write into the memory card are thus completed.
One of the following methods has been used as the fixed length process. In the first fixed length method, a compression process is performed once at a standard compression factor. If the amount of generated coded data is larger than a target data amount, a compression factor higher than the standard compression factor is set. Whereas if the amount of generated coded data is smaller than the target data amount, a compression factor lower than the standard compression factor is set. Image data is then compressed at this new compression factor to generate final coded image data.
However, the relationship between a compression factor and the amount of coded data is not always constant. Therefore, an error between the target data amount and the amount of generated coded data changes with the kind of images, and a precision of the fixed length process is low if the statistic process is executed only once.
In the second fixed length method, a precision of the fixed length process is made higher by executing the statistical process twice in determining a final compression factor. During the first statistical process, the compression process is executed at a first standard compression factor to estimate the amount of coded data. Next, during the second statistical process, the compression process is executed at a second standard compression factor different from the first standard compression factor to estimate the amount of coded data. A final compression factor is determined from the two standard compression factors. For example, if a target data amount is between the estimated two amounts of coded data, the final compression factor is set between the first and second standard compression factors. Image data is then compressed at this new compression factor to generate final coded image data.
With this second fixed length method, however, it is necessary to execute the statistical process twice, and the final compression process is executed once, totaling three compression processes which takes a long process time.